<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
  <form action="${pageContext.request.contextPath }/SelectDeptByDnameServlet">
    <input type="text" name="dname">
    <input type="submit" value="查询">
  </form>
  <table>
    <tr>
      <th>编号</th>
      <th>部门名称</th>
      <th>地址</th>
    </tr>
    <c:if test="${! empty(depts) }">
      <c:forEach items="${depts }" var="dept">
        <tr>
        <td>${dept.deptno }</td>
         <td>${dept.dname }</td>
          <td>${dept.loc }</td>
        </tr>
      </c:forEach>
    </c:if>
  </table>
</body>
</html>